/*
 * game.h
 *
 *  Created on: 24-Apr-2009
 *      Author: catchthealien
 */

#ifndef GAME_H_
#define GAME_H_

#include <stdio.h>
#include <string>

#include "framelimiter.h"
#include "input.h"
#include "loadingscreen.h"
#include "background.h"
#include "player.h"
#include "alien.h"
#include "collision.h"
#include "simple_ai_1.h"

namespace cta {

class game {
private:
	std::string game_type;
protected:
	bool q_state_;
	short init_state;
	framelimiter graphicsframelimiter_;
	framelimiter colissionframelimiter_;
	/// A pointer to the view which contains the camera.
	csRef<iView> view;
	// Sector
	csRef<iSector> space;
	csRef<iRegion> region;
	// Loading screen
	loadingscreen loadingscreen_;
	int StartTime;
	// Background
	cta::background background_;
	// Objects
	cta::objects::player player_;
	cta::objects::alien alien_;

	// AI
	cta::ai::simple_ai_1* player_ai;
public:
	game();
	virtual ~game();
	bool Init();
	bool Init(std::string g_type);
	bool Run();
	bool Draw();
	bool End();
    bool getState() const
    {
        return q_state_;
    }

    void setState(bool q_state_)
    {
        this->q_state_ = q_state_;
    }

};

}

#endif /* GAME_H_ */
